﻿namespace Seagull.Foundation
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public interface IQueryRepository<TEntity> where TEntity : class, new()
    {
        /// <summary>
        /// 根据id获取单个资源
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        TEntity Browse(long id);

        /// <summary>
        /// 根据id的集合获取多个资源
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        IEnumerable<TEntity> BrowseFor(long[] ids);

        /// <summary>
        /// 根据关键字搜索符合记录的记录
        /// </summary>
        /// <param name="keyword">关键字</param>
        /// <returns></returns>
        IEnumerable<TEntity> Query(string keyword);
    }
}
